package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"time"
)

func main() {
	for {
		go get_pic()
		time.Sleep(time.Millisecond * 20)
	}
}

func get_pic() {
	defer func() {
		if p := recover(); p != nil {
			fmt.Printf("Recovered panic:%s\n", p)
		}
	}()

	pic_url := "http://www.xylbh.cn:91/XYLPIC/goods_new/10/02/30/1002301836-L-1.jpg"
	resp, _ := http.Get(pic_url)
	defer resp.Body.Close()
	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println("status:", resp.Status)
	fmt.Println("lenth of body:", len(body))
}
